package org.dromara.learning_lhz.controller;

import org.dromara.learning_lhz.entity.AsStudyEntity;
import org.dromara.learning_lhz.service.StudyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 学情测评
 */
@RestController
@RequestMapping("/study")
public class StudyController {

    @Autowired
    private StudyService studyService;

    /**
     * 根据条件查询试卷
     * @param asStudyEntity
     * @return
     */
    @PostMapping("selStudy")
    public List<AsStudyEntity> selStudy(@RequestBody AsStudyEntity asStudyEntity) {
        return studyService.selStudy(asStudyEntity);
    }

    /**
     * 添加试卷
     * @param asStudyEntity
     * @return
     */
    @PostMapping("addStudy")
    public void addStudy(@RequestBody AsStudyEntity asStudyEntity) {
         studyService.addStudy(asStudyEntity);
    }
    /**
     * 修改试卷
     * @param asStudyEntity
     * @return
     */
    @PostMapping("updateStudy")
    public void updateStudy(@RequestBody AsStudyEntity asStudyEntity) {
        studyService.updateById(asStudyEntity);
    }

    /**
     * 删除试卷
     * @param asStudyEntity
     * @return
     */
    @PostMapping("delStudy")
    public void delStudy(@RequestBody AsStudyEntity asStudyEntity) {
        studyService.removeById(asStudyEntity);
    }


}
